class FridgeMagnetData ():

    def __init__(self) -> None:
        self.FMData = []
    

    def AddMemo (self,text,identity): #新加冰箱贴
        memo = {'Identity':identity,'Text':text,'Read':0}
        self.FMData.append(memo)


    def ReadMemo (self,index,identity): #阅读冰箱贴
        text = self.FMData[index]['Text']

        if self.FMData[index]['Identity'] != identity: #非本人阅读撕下便签
            self.FMData[index]['Read'] = 1

        return text

    
    def MemoList (self): #显示冰箱贴列表
        memo_list = []

        for i in range (0,len(self.FMData)):
            if len(memo_list) == 12: #最多显示12张
                break

            if self.FMData[i]['Read'] == 0: #显示未被阅读的冰箱贴
                memo_list.append(i)
        
        return memo_list